import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'bottom_nav_widget/bottom_bar_widget_view.dart';
import 'my_home_logic.dart';

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final MyHomeLogic logic = Get.put(MyHomeLogic());

  @override
    Widget build(BuildContext context) {
      return GetBuilder<MyHomeLogic>(
        builder: (controller) {
          return Scaffold(
            body: controller.currentPage,
            bottomNavigationBar: BottomBarWidgetPage(
              onTap: (v) => controller.setCurrentPage(v),
            ),
          );
        },
      );
    }

  @override
  void dispose() {
    Get.delete<MyHomeLogic>();
    super.dispose();
  }
}